package sk.dudas.appengine.alicasperk.endpoint.example;

import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.Named;
import sk.dudas.appengine.alicasperk.Constants;

import java.util.ArrayList;

@Api(
        name = "exampleoli",
        version = "v1"
)
public class Examples {

    public static ArrayList<HelloGreeting> greetings = new ArrayList<HelloGreeting>();

    static {
        greetings.add(new HelloGreeting("hello world!"));
        greetings.add(new HelloGreeting("goodbye world!"));
    }

    public HelloGreeting getGreeting(@Named("id") Integer id) {
        return greetings.get(id);
    }

    public ArrayList<HelloGreeting> listGreeting() {
        return greetings;
    }

}
